<!DOCTYPE html><html>

<head>
<meta charset="utf-8">
<title></title>
<style>
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}
html{line-height:1}
ol,ul{list-style:none}
table{border-collapse:collapse;border-spacing:0;
  margin-top: 0;
  margin-bottom: 0.8em;
}
caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}
q,blockquote{quotes:none}
q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}
a img{border:none}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block}
a{color:#1863a1}
a:visited{color:#751590}
a:focus{color:#0181eb}
a:hover{color:#0181eb}
a:active{color:#01579f}
aside.sidebar a{color:#222}
aside.sidebar a:focus{color:#0181eb}
aside.sidebar a:hover{color:#0181eb}
aside.sidebar a:active{color:#01579f}
a{-webkit-transition:color 0.3s;-moz-transition:color 0.3s;-o-transition:color 0.3s;transition:color 0.3s}

body,h1,h2,h3,h4,h5,h6,footer{font-family:"PT Sans","Helvetica Neue","Optima","Hiragino Sans GB",sans-serif}
body{line-height:1.5em;color:#222
	-webkit-text-size-adjust:none;  min-width: 200px;
  max-width: 760px;
  margin: 0 auto; padding: 1em;}

pre,code,tt,p code,li code{font-family:Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace}

h1{font-size:2.2em;line-height:1.2em}

h1,h2,h3,h4,h5,h6{text-rendering:optimizelegibility;margin-bottom:1em;font-weight:bold}
h2,section h1{font-size:1.5em}
h3,section h2,section section h1{font-size:1.3em}
h4,section h3,section section h2,section section section h1{font-size:1em}
h5,section h4,section section h3{font-size:.9em}
h6,section h5,section section h4,section section section h3{font-size:.8em}
.markdown-body{padding: 0px 4px;}
.markdown-body h1{position:relative;padding-top:1em;padding-bottom:0.2em;margin-bottom:1em;background:url('') bottom left repeat-x}
.markdown-body  h1 a{text-decoration:none}
.markdown-body  h1 a:hover{text-decoration:underline}

.markdown-body h2{padding-top:0.8em;padding-bottom:0.2em;background:url('') bottom left repeat-x}
.markdown-body h2:first-child,.markdown-body header+h2{padding-top:0}
.markdown-body h2:first-child,.markdown-body header+h2{background:none}



p,.markdown-body blockquote,ul,ol{margin-bottom:0.8em; margin-top:0.8em;}
ul{list-style-type:disc}
ul ul{list-style-type:circle;margin-bottom:0px}
ul ul ul{list-style-type:square;margin-bottom:0px}
ol{list-style-type:decimal}
ol ol{list-style-type:lower-alpha;margin-bottom:0px}
ol ol ol{list-style-type:lower-roman;margin-bottom:0px}
ul,ul ul,ul ol,ol,ol ul,ol ol{margin-left:1.3em}
ul ul,ul ol,ol ul,ol ol{margin-bottom:0em}
strong{font-weight:bold}
em{font-style:italic}
sup,sub{font-size:0.75em;position:relative;display:inline-block;padding:0 .2em;line-height:.8em}
sup{top:-.5em}
sub{bottom:-.5em}
a[rev='footnote']{font-size:.75em;padding:0 .3em;line-height:1}
q{font-style:italic}
q:before{content:"\201C"}
q:after{content:"\201D"}
em,dfn{font-style:italic}
strong,dfn{font-weight:bold}
del,s{text-decoration:line-through}
abbr,acronym{border-bottom:1px dotted;cursor:help}
small{font-size:.8em}
big{font-size:1.2em}

.markdown-body hr {
  height: 0;
  margin: 15px 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #ddd;
}

.markdown-body hr:before {
  display: table;
  content: "";
}

.markdown-body hr:after {
  display: table;
  clear: both;
  content: "";
}


.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  word-break: normal;
  word-break: keep-all;
}

.markdown-body table th {
  font-weight: bold;
}

.markdown-body table th,
.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid #ddd;
}

.markdown-body table tr {
  background-color: #fff;
  border-top: 1px solid #ccc;
}

.markdown-body table tr:nth-child(2n) {
  background-color: #f8f8f8;
}

.markdown-body blockquote{font-style:italic;position:relative;font-size:1.2em;line-height:1.5em;padding-left:1em;border-left:4px solid rgba(170,170,170,0.5)}
.markdown-body blockquote cite{font-style:italic}
.markdown-body blockquote cite a{color:#aaa !important;word-wrap:break-word}
.markdown-body blockquote cite:before{content:'\2014';padding-right:.3em;padding-left:.3em;color:#aaa}

.markdown-body a{white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word}

body>header{font-size:1em;padding-top:1.5em;padding-bottom:1.5em}
.markdown-body{overflow:hidden}
.markdown-body>div,.markdown-body>article{width:100%}
aside.sidebar{float:none;padding:0 18px 1px;background-color:#f7f7f7;border-top:1px solid #e0e0e0}
.flex-content,article img,article video,article .flash-video,aside.sidebar img{max-width:100%;height:auto}
.basic-alignment.left,article img.left,article video.left,article .left.flash-video,aside.sidebar img.left{float:left;margin-right:1.5em}
.basic-alignment.right,article img.right,article video.right,article .right.flash-video,aside.sidebar img.right{float:right;margin-left:1.5em}
.basic-alignment.center,article img.center,article video.center,article .center.flash-video,aside.sidebar img.center{display:block;margin:0 auto 1.5em}
.basic-alignment.left,article img.left,article video.left,article .left.flash-video,aside.sidebar img.left,.basic-alignment.right,article img.right,article video.right,article .right.flash-video,aside.sidebar img.right{margin-bottom:.8em}
.toggle-sidebar,.no-sidebar .toggle-sidebar{display:none}


.markdown-body img,.markdown-body video,.markdown-body .flash-video{ -webkit-border-radius:0.3em;-moz-border-radius:0.3em;-ms-border-radius:0.3em;-o-border-radius:0.3em;border-radius:0.3em;-webkit-box-shadow:rgba(0,0,0,0.15) 0 1px 4px;-moz-box-shadow:rgba(0,0,0,0.15) 0 1px 4px;box-shadow:rgba(0,0,0,0.15) 0 1px 4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:#fff 0.5em solid;}

.markdown-body img,.markdown-body video{max-width: 100%;}
.markdown-body video,.markdown-body .flash-video{margin:0 auto 1.5em}
.markdown-body video{display:block;width:100%}
.markdown-body .flash-video>div{position:relative;display:block;padding-bottom:56.25%;padding-top:1px;height:0;overflow:hidden}
.markdown-body .flash-video>div iframe,.markdown-body .flash-video>div object,.markdown-body .flash-video>div embed{position:absolute;top:0;left:0;width:100%;height:100%}
.markdown-body>footer{padding-bottom:2.5em;margin-top:2em}
.markdown-body>footer p.meta{margin-bottom:.8em;font-size:.85em;clear:both;overflow:hidden}


body,pre{ background:#fdf6e3 url('') top left;}
body{ background-color: #f8f8f8;}
pre{-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;border:1px solid #e7dec3;line-height:1.45em;font-size:13px;margin-bottom:2.1em;padding:.8em 1em;color:#586e75;overflow:auto}
.markdown-body code{background: none;}
h3.filename+pre{-moz-border-radius-topleft:0px;-webkit-border-top-left-radius:0px;border-top-left-radius:0px;-moz-border-radius-topright:0px;-webkit-border-top-right-radius:0px;border-top-right-radius:0px}
p code,li code{display:inline-block;white-space:no-wrap;background:#fff;font-size:.8em;line-height:1.5em;color:#555;border:1px solid #ddd;-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;padding:0 .3em;margin:-1px 0}
p pre code,li pre code{font-size:1em !important;background:none;border:none}

/*

Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>

*/

.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  background: #fdf6e3;
  color: #657b83;
  -webkit-text-size-adjust: none;
}

.hljs-comment,
.diff .hljs-header,
.hljs-doctype,
.hljs-pi,
.lisp .hljs-string {
  color: #93a1a1;
}

/* Solarized Green */
.hljs-keyword,
.hljs-winutils,
.method,
.hljs-addition,
.css .hljs-tag,
.hljs-request,
.hljs-status,
.nginx .hljs-title {
  color: #859900;
}

/* Solarized Cyan */
.hljs-number,
.hljs-command,
.hljs-string,
.hljs-tag .hljs-value,
.hljs-rule .hljs-value,
.hljs-doctag,
.tex .hljs-formula,
.hljs-regexp,
.hljs-hexcolor,
.hljs-link_url {
  color: #2aa198;
}

/* Solarized Blue */
.hljs-title,
.hljs-localvars,
.hljs-chunk,
.hljs-decorator,
.hljs-built_in,
.hljs-identifier,
.vhdl .hljs-literal,
.hljs-id,
.css .hljs-function,
.hljs-name {
  color: #268bd2;
}

/* Solarized Yellow */
.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.smalltalk .hljs-number,
.hljs-constant,
.hljs-class .hljs-title,
.hljs-parent,
.hljs-type,
.hljs-link_reference {
  color: #b58900;
}

/* Solarized Orange */
.hljs-preprocessor,
.hljs-preprocessor .hljs-keyword,
.hljs-pragma,
.hljs-shebang,
.hljs-symbol,
.hljs-symbol .hljs-string,
.diff .hljs-change,
.hljs-special,
.hljs-attr_selector,
.hljs-subst,
.hljs-cdata,
.css .hljs-pseudo,
.hljs-header {
  color: #cb4b16;
}

/* Solarized Red */
.hljs-deletion,
.hljs-important {
  color: #dc322f;
}

/* Solarized Violet */
.hljs-link_label {
  color: #6c71c4;
}

.tex .hljs-formula {
  background: #eee8d5;
}


</style>

<style> @media print{ .hljs{overflow: visible; word-wrap: break-word !important;} }</style></head><body><div class="markdown-body">
<ul>
<li>
<a href="#toc_0">排麦组件</a>
</li>
<li>
<a href="#toc_1">1. 排麦模式</a>
<ul>
<li>
<a href="#toc_2">1.1 举手连麦</a>
<ul>
<li>
<a href="#toc_3">1.1.1 学生可举手申请连麦,需老师确认才可连麦</a>
</li>
<li>
<a href="#toc_4">1.1.2 老师可以邀请学生连麦,需学生同意才可连麦</a>
</li>
</ul>
</li>
<li>
<a href="#toc_5">1.2 自由连麦</a>
<ul>
<li>
<a href="#toc_6">1.2.1 学生可自由连麦,无需老师确认</a>
</li>
</ul>
</li>
<li>
<a href="#toc_7">1.3 自动连麦</a>
<ul>
<li>
<a href="#toc_8">1.3.1 学生进入房间后自动连麦</a>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#toc_9">2. 排麦事件</a>
<ul>
<li>
<a href="#toc_10">2.0 请求连麦</a>
</li>
<li>
<a href="#toc_11">2.1 同意学生举手连麦</a>
</li>
<li>
<a href="#toc_12">2.2 取消连麦</a>
</li>
<li>
<a href="#toc_13">2.3 主动下麦</a>
</li>
<li>
<a href="#toc_14">2.4 邀请学生上麦</a>
</li>
<li>
<a href="#toc_15">2.5 取消邀请</a>
</li>
<li>
<a href="#toc_16">2.6 接受老师邀请</a>
</li>
<li>
<a href="#toc_17">2.7 拒绝老师连麦邀请</a>
</li>
<li>
<a href="#toc_18">2.8 上麦更新</a>
</li>
<li>
<a href="#toc_19">2.9 学生举手</a>
</li>
<li>
<a href="#toc_20">2.10 学生取消举手</a>
</li>
<li>
<a href="#toc_21">2.11 踢人下麦</a>
</li>
<li>
<a href="#toc_22">2.12 设置连麦模式（可设置举手连麦，自由连麦，自动连麦，仅只有老师端）</a>
<ul>
<li>
<a href="#toc_23">2.13 全体下麦(老师)</a>
</li>
</ul>
</li>
<li>
<a href="#toc_24">3.2 学生排麦状态通知（上麦和下麦的回调通知）</a>
</li>
<li>
<a href="#toc_25">3.3 移除监听</a>
</li>
<li>
<a href="#toc_26">3.3 监听排麦其它相关事件</a>
</li>
</ul>
</li>
</ul>


<h1 id="toc_0">排麦组件</h1>

<p>聊天组件的核心类是CCBarleyManager;</p>

<pre><code class="language-objc">//在工程需要的地方引入头文件
#import &lt;CCBarleyLibrary/CCBarleyLibrary.h&gt;

//1、类的实例化
+ (instancetype)sharedBarley;

//2、与BaseSDK建立联系
- (void)addBasicClient:(CCStreamerBasic *)basic;
</code></pre>

<h1 id="toc_1">1. 排麦模式</h1>

<h2 id="toc_2">1.1 举手连麦</h2>

<h3 id="toc_3">1.1.1 学生可举手申请连麦,需老师确认才可连麦</h3>

<h3 id="toc_4">1.1.2 老师可以邀请学生连麦,需学生同意才可连麦</h3>

<h2 id="toc_5">1.2 自由连麦</h2>

<h3 id="toc_6">1.2.1 学生可自由连麦,无需老师确认</h3>

<h2 id="toc_7">1.3 自动连麦</h2>

<h3 id="toc_8">1.3.1 学生进入房间后自动连麦</h3>

<h1 id="toc_9">2. 排麦事件</h1>

<h2 id="toc_10">2.0 请求连麦</h2>

<p>点击自由连麦、举手，以及自动连麦都必须要调用该接口</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 开始连麦(改为排麦中)
 @return 操作结果
 */
- (BOOL)handsUp:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_11">2.1 同意学生举手连麦</h2>

<p>举手状态由互动者端发起，通知老师端，老师端可以同意或者不同意。</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 同意举手学生连麦
 @param userID 学生ID
 @param completion 结果
 @return 操作结果
 */
- (BOOL)certainHandup:(NSString *)userID completion:(CCComletionBlock)completion;

</code></pre>

<h2 id="toc_12">2.2 取消连麦</h2>

<p>点击自由连麦、举手，以及自动连麦都必须要调用该接口</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 取消排麦
 @return 操作结果
 */
- (BOOL)handsUpCancel:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_13">2.3 主动下麦</h2>

<p>点击自由连麦、举手，以及自动连麦都必须要调用该接口</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 结束连麦
 @return 操作结果
 */
- (BOOL)handsDown:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_14">2.4 邀请学生上麦</h2>

<p>老师端发送邀请，接收端是互动者。</p>

<p>应用模式：举手连麦</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 老师邀请没有举手学生连麦(只对老师有效)
 @param userID 学生ID
 @return 操作结果
 */
- (BOOL)inviteUserSpeak:(NSString *)userID completion:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_15">2.5 取消邀请</h2>

<p>取消邀请由老师端发起</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 老师取消对学生的上麦邀请
 @param userID 学生ID
 @param completion 结果
 @return 操作结果
 */
- (BOOL)cancleInviteUserSpeak:(NSString *)userID completion:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_16">2.6 接受老师邀请</h2>

<p>学生端接受老师的上麦邀请，同意上麦。</p>

<p>应用模式：举手连麦</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 同意老师的上麦邀请
 @param completion 结果
 @return 操作结果
 */
- (BOOL)acceptTeacherInvite:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_17">2.7 拒绝老师连麦邀请</h2>

<p>拒绝老师连麦邀请由学生端发起</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 拒绝老师的连麦邀请
 @param completion 结果
 @return 操作结果
 */
- (BOOL)refuseTeacherInvite:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_18">2.8 上麦更新</h2>

<p>上麦更新是在两种情况下执行</p>

<p>​   1.推流成功之后为更新自己上麦状态，通知其他人订阅，需调用。</p>

<p>​   2.学生不能创建本地流或者推流失败，需将其麦序让出。</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 更新连麦状态
 @param userID 用户id
 @param roomID 房间id
 @param result 推流结果
 @param streamID 流id
 @param completion 回调block
 @return 操作结果
 */
- (BOOL)updateUserState:(NSString *)userID roomID:(NSString *)roomID publishResult:(BOOL)result streamID:(NSString *)streamID completion:(CCComletionBlock)completion;
</code></pre>

<h2 id="toc_19">2.9 学生举手</h2>

<p>举手状态由互动者端发起，通知老师端，老师端可以同意或者不同意。</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 学生举手
 @return 状态
 */
- (BOOL)handup;
</code></pre>

<h2 id="toc_20">2.10 学生取消举手</h2>

<p>举手状态由互动者端发起，通知老师端，老师端可以同意或者不同意。</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 学生取消举手
 @return 状态
 */
- (BOOL)cancleHandup;
</code></pre>

<h2 id="toc_21">2.11 踢人下麦</h2>

<p>老师端发起踢人下麦</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 将连麦者踢下麦
 @param userID 连麦者userID
 
 @return 操作结果
 */
- (BOOL)kickUserFromSpeak:(NSString *)userID completion:(CCComletionBlock)completion;

</code></pre>

<h2 id="toc_22">2.12 设置连麦模式（可设置举手连麦，自由连麦，自动连麦，仅只有老师端）</h2>

<p>老师端设置连麦模式</p>

<p>应用模式：举手连麦，自由连麦，自动连麦。</p>

<pre><code class="language-objc">/*!
 @method
 @abstract 切换连麦模式
 @param type 模式
 @return 操作结果
 */
- (BOOL)setSpeakMode:(CCClassType)type completion:(CCComletionBlock)completion;

</code></pre>

<h3 id="toc_23">2.13 全体下麦(老师)</h3>

<p>老师端调用全体下麦</p>

<pre><code class="language-objc">/**
 @method
 @abstract 切换房间上麦状态(全部踢下麦)
 
 @param completion 回调
 @return 操作结果
 */
- (BOOL)changeRoomAllKickDown:(CCComletionBlock)completion;
​````

# 3. 排麦通知事件

下面所有的场景都以demo为例，如场景：CCPlayViewController控制器，具体可参考demo实现；

## 3.1 监听流服务事件
这里需要控制器实现‘’CCStreamerBasicDelegate&#39;协议的4个流相关事件，如下：
​```objc
/**
 @brief Triggers when client is disconnected from conference server.
 */
- (void)onServerDisconnected;
/**
 @brief Triggers when a stream is added.
 @param stream The stream which is added.
 */
- (void)onStreamAdded:(CCStream*)stream;
/**
 @brief Triggers when a stream is removed.
 @param stream The stream which is removed.
 */
- (void)onStreamRemoved:(CCStream*)stream;
/**
 @brief Triggers when an error happened on a stream.
 @detail This event only triggered for a stream that is being publishing or
 subscribing. SDK will not try to recovery the certain stream when this event
 is triggered. If you still need this stream, please re-publish or
 re-subscribe.
 @param stream The stream which is corrupted. It might be a LocalStream or
 RemoteStream.
 @param error The error happened. Currently, errors are reported by MCU.
 */
- (void)onStreamError:(NSError *)error forStream:(CCStream *)stream;
</code></pre>

<p>具体实现请参考demo实现；</p>

<h2 id="toc_24">3.2 学生排麦状态通知（上麦和下麦的回调通知）</h2>

<p>在需要的控制器使用时添加监听事件</p>

<pre><code class="language-objc">-(void)addObserver
{   
    //添加排麦房间状态监听
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveSocketEvent:) name:CCNotiReceiveSocketEvent object:nil];
    //这块监听是监听上麦状态事件，逻辑可以根据需要设置
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startPublish) name:CCNotiNeedStartPublish object:nil];
    //这块监听是监听下麦状态事件，逻辑可以根据需要设置
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopPublish) name:CCNotiNeedStopPublish object:nil];
    //用户需要退出通知
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needLogout) name:CCNotiNeedLoginOut object:nil];
}
  &#39;startPublish&#39;、&#39;stopPublish&#39;、&#39;needLogout&#39; - &#39;监听事件请参考demo实现&#39;
  &#39;receiveSocketEvent:&#39; - &#39;下面会讲述&#39;

</code></pre>

<h2 id="toc_25">3.3 移除监听</h2>

<p>在控制器生命周期结束或不展现时移除监听；</p>

<pre><code class="language-objc">-(void)removeObserver
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
</code></pre>

<h2 id="toc_26">3.3 监听排麦其它相关事件</h2>

<p>这里主要监听房间状态及交互事件</p>

<pre><code class="language-objc">- (void)receiveSocketEvent:(NSNotification *)noti
{
    CCSocketEvent event = (CCSocketEvent)[noti.userInfo[@&quot;event&quot;] integerValue];
    id value = noti.userInfo[@&quot;value&quot;];
  
    if (event == CCSocketEvent_LianmaiStateUpdate)
    {
        //连麦状态变化
    }
    else if (event == CCSocketEvent_KickFromRoom)
    {
      //被踢出房间
    }
    else if (event == CCSocketEvent_LianmaiModeChanged)
    {
        //连麦模式变化
    }
    else if (event == CCSocketEvent_ReciveLianmaiInvite)
    {
        //在举手连麦模式中收到老师的连麦邀请
        //这块监听是监听邀请状态事件，逻辑可以根据需要设置
    }
    else if (event == CCSocketEvent_ReciveCancleLianmaiInvite)
    {
        //老师取消了连麦邀请
        //这块监听是监听取消邀请状态事件，逻辑可以根据需要设置
    }
    else if (event == CCSocketEvent_HandupStateChanged)
    {
        //收到举手状态改变
    }
    else if(event == CCSocketEvent_UserListUpdate)
    {
      //在线列表
    }
}
</code></pre>

<br><br><br><br>

</div></body>

</html>
